package com.taxsystem.chengwenzhi.sscx;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.ActionBar;
import android.app.Activity;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

import com.main.taxsystem.R;

public class SbfcxActivity extends Activity {
	private static final String TAG = "SbfcxActivity";
	private TextView employeeNameTextView = null;
	private TextView identityTextView = null;
	private TextView grsbhTextView = null;
	private ListView listView = null;
	private ArrayList<HashMap<String, String>> list;
	private SimpleAdapter adapter = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_sbfcx);
		
		ActionBar bar = getActionBar();
        bar.setHomeButtonEnabled(true);
        bar.setIcon(R.drawable.actionbar_icon);
        bar.setDisplayHomeAsUpEnabled(true);
        bar.setBackgroundDrawable(new ColorDrawable(0xff34a4f7));
        
		employeeNameTextView = (TextView)this.findViewById(R.id.sbfcx_textView_employeeMame);
		identityTextView = (TextView) this.findViewById(R.id.sbfcx_textView_identity);
		grsbhTextView = (TextView) this.findViewById(R.id.sbfcx_textView_grsbh);
		list = new ArrayList<HashMap<String,String>>();
		listView = (ListView) this.findViewById(R.id.listView);
		
		employeeNameTextView.setText("李四");
		identityTextView.setText("4415221955555555");
		grsbhTextView.setText("2368462");
		
		adapter = new SimpleAdapter(SbfcxActivity.this, list,
				R.layout.activity_sbfcx_list_item, 
				new String[] { "fkssq",
						"ylbx_jfgz", "ylbx_dw", "ylbx_gr", "gsbx_jfgz",
						"gsbx_dw", "sybx_jfgz", "sybx_dw", "jbylbx_jfgz",
						"jbylbx_dw", "jbylbx_gr", "zdjb_jfgz", "zdjb_dw",
						"syubx_jfgz", "syubx_dw" }, 
				new int[]{
				R.id.sbfcx_listItem_fkssq,
				R.id.sbfcx_listItem_ylbx_jfgz,
				R.id.sbfcx_listItem_ylbx_dw,
				R.id.sbfcx_listItem_ylbx_gr,
				R.id.sbfcx_listItem_gsbx_jfgz,
				R.id.sbfcx_listItem_gsbx_dw,
				R.id.sbfcx_listItem_sybx_jfgz,
				R.id.sbfcx_listItem_sybx_dw,
				R.id.sbfcx_listItem_jbylbx_jfgz,
				R.id.sbfcx_listItem_jbylbx_dw,
				R.id.sbfcx_listItem_jbylbx_gr,
				R.id.sbfcx_listItem_zdjb_jfgz,
				R.id.sbfcx_listItem_zdjb_dw,
				R.id.sbfcx_listItem_syubx_jfgz,
				R.id.sbfcx_listItem_syubx_dw
		});
		
		listView.setAdapter(adapter);
		
		buildTestData();
	}

	private void buildTestData() {
		HashMap<String,String> map = null;
		map = new HashMap<String,String>();
		map.put("fkssq", "201402");
		map.put("ylbx_jfgz", "2355");
		map.put("ylbx_dw", "256.21");
		map.put("ylbx_gr", "171.12");
		map.put("gsbx_jfgz", "2000");
		map.put("gsbx_dw", "100");
		map.put("sybx_jfgz", "2000");
		map.put("sybx_dw", "100");
		map.put("jbylbx_jfgz", "3000");
		map.put("jbylbx_dw", "240");
		map.put("jbylbx_gr", "60");
		map.put("zdjb_jfgz", "3000");
		map.put("zdjb_dw", "10");
		map.put("syubx_jfgz", "3000");
		map.put("syubx_dw", "12");
		list.add(map);
		
		map = new HashMap<String,String>();
		map.put("fkssq", "201402");
		map.put("ylbx_jfgz", "2355");
		map.put("ylbx_dw", "256.21");
		map.put("ylbx_gr", "171.12");
		map.put("gsbx_jfgz", "2000");
		map.put("gsbx_dw", "100");
		map.put("sybx_jfgz", "2000");
		map.put("sybx_dw", "100");
		map.put("jbylbx_jfgz", "3000");
		map.put("jbylbx_dw", "240");
		map.put("jbylbx_gr", "60");
		map.put("zdjb_jfgz", "3000");
		map.put("zdjb_dw", "10");
		map.put("syubx_jfgz", "3000");
		map.put("syubx_dw", "12");
		list.add(map);

	}

}
